<template>
  <div class="app-container">
    <el-form :model="queryForm" ref="queryForm" v-show="showSearch" :inline="true" label-width="100px">

      <el-row>
        <el-col :span="6">
      <el-form-item label="合同名称">
        <el-input size="mini" v-model="queryForm.conCode"/>
      </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="码头">
            <el-select v-model="queryForm.companyNam" placeholder="请选择码头" @change="handleQuery" size="mini" clearable>
              <el-option
                  v-for="item in companyCodeOptions"
                  :key="item.value"
                  :label="item.label"
                  :value="item.label">
              </el-option>
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="6">
          <el-form-item label="是否通用">
            <el-select
              v-model="queryForm.isTemplate"
              placeholder="是否通用"
              @change="handleQuery"
              clearable
              size="mini"
            >
              <el-option
                v-for="dict in isTemplateOptions"
                :key="dict.value"
                :label="dict.label"
                :value="dict.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
      </el-row>

      <el-form-item label='合同有效期' prop="conStartTime">
        <el-date-picker
          v-model="queryForm.conStartTime"
          type="date"
          size="mini"
          value-format="yyyy-MM-dd"
          placeholder="开始日期"
          >
        </el-date-picker>
      </el-form-item>
      <el-form-item prop="conEndTime">
        <el-date-picker
          v-model="queryForm.conEndTime"
          type="date"
          size="mini"
          value-format="yyyy-MM-dd"
          placeholder="结束日期"
          >
        </el-date-picker>
      </el-form-item>

      <el-form-item label='合同创建时间' prop="createTime">
        <el-date-picker
          v-model="queryForm.createTimeFormate"
          type="date"
          size="mini"
          value-format="yyyy-MM-dd"
          placeholder="筛选该时间之后创建的合同"
          @change="handleQuery"
        >
        </el-date-picker>
      </el-form-item>


      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="getListType">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="chonzhi">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          v-hasPermi="['base:contract:add']"
          @click="$router.push({path:'/con/condetail'});"
        >新增合同</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-document-delete"
          size="mini"
          @click="handleInvalid"
          v-hasPermi="['base:contract:zfht']"
        >作废合同</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-document-delete"
          size="mini"
          @click="restoreHandleInvalid"
          v-hasPermi="['base:contract:zfht']"
        >恢复作废合同</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-document-delete"
          size="mini"
          @click="deleteHandleInvalid"
          v-hasPermi="['base:contract:zfht']"
        >删除合同</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
            type="primary"
            plain
            icon="el-icon-document-delete"
            size="mini"
            @click="handleCopyContract"
            v-hasPermi="['base:contract:zfht']"
        >复制合同</el-button>
      </el-col>
    </el-row>

    <el-table
    highlight-current-row
    ref="conTable"
    row-key="conId"
    :tree-props="{children: 'childrenConBusiness', hasChildren: 'hasChildren'}"
    @current-change="handleChoseChange"
    @selection-change="handleSelectionChange"
    :cell-class-name="delLine"
    :data="conBusinessList"
    >
      <!-- <el-table-column type="selection" width="55" align="center" /> -->
      <!-- <el-table-column prop="conId" label="id" align="center"/> -->
<!--      <el-table-column type="selection" width="55" align="center" fixed/>-->
      <el-table-column prop="conCode" label="合同名称" align="center" width="120">
        <template slot-scope="scope">
          <router-link :to="'/con/condetail/data/' + scope.row.conId" class="link-type">
            <span>{{ scope.row.conCode }}</span>
          </router-link>
        </template>
      </el-table-column>
      <el-table-column prop="conId" label="合同ID" align="center"/>
      <el-table-column prop="conStartTime" label="合同开始时间" width="125" align="center" show-overflow-tooltip sortable/>
      <el-table-column prop="conEndTime" label="合同结束时间" width="125" align="center" show-overflow-tooltip sortable/>
      <el-table-column prop="companyNam" label="码头" align="center"/>
      <el-table-column prop="isTemplate" label="是否通用" align="center" width="80"/>
      <el-table-column prop="remark" label="备注" align="center" width="300"/>
      <el-table-column prop="createBy" label="创建人" align="center"/>
      <el-table-column prop="updateBy" label="更新人" align="center"/>
      <el-table-column prop="updateTime" label="更新时间" align="center" width="150"/>
      <el-table-column prop="createTime" label="创建时间" align="center" width="150"  sortable/>
      <!--<el-table-column label="操作" align="center" width="180" class-name="small-padding fixed-width" fixed="right">-->
        <!--<template slot-scope="scope">-->
          <!--<el-button-->
            <!--size="mini"-->
            <!--type="text"-->
            <!--icon="el-icon-document-copy"-->
            <!--@click="handleCopy(scope.row)"-->
          <!--&gt;复制</el-button>-->
        <!--</template>-->
      <!--</el-table-column>-->
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryForm.pageNum"
      :limit.sync="queryForm.pageSize"
      @pagination="getList"
    />


  </div>
</template>

<script>

import {deleteContractById,editContract,getContractById,listBusiness,getConFile,checkCon,frozenContractById,nullifyContractById,restoreNullifyContractById,copyConBusiness,interimOper,delayOper,listConFile,getConFileByFileId,deleteConFileByFileId,listBusinessType} from '@/api/contract/conbusiness'
import { getToken } from '@/utils/auth'
import tosWorkPlaceOptionsMixin from "@/mixin/tos/tosWorkPlaceOptionsMixin";

import axios from 'axios';

let Base64  = require('js-base64').Base64

  export default {
    props: {
      // 值
      value: [String, Object, Array],
      // 大小限制(MB)
      fileSize: {
        type: Number,
        default: 10,
      },
      // 文件类型, 例如['png', 'jpg', 'jpeg']
      fileType: {
        type: Array,
        default: () => ["doc", "xls", "ppt", "txt", "pdf"],
      },
      // 是否显示提示
      isShowTip: {
        type: Boolean,
        default: true
      }
    },

    name:'Major',
    mixins: [tosWorkPlaceOptionsMixin],
    data () {
      return {
        total:0,
        queryForm:{
          pageNum:1,
          pageSize:10
        },
        queryFormSx:{
          pageNum:1,
          pageSize:10
        },
        isTemplateOptions: [{label: '否', value: '0'}, {label: '是', value: '1'}],
        selectedconEffType:[],
        selectedStatus:[],
        downloadUrl:'/file/downloadFile',
        conSupplyOptions:[],
        conEffOptions:[],
        conDetailForm:{
          conStartTime:''
        },
        conBusOptions:[],
        showSearch:true,
        conBusinessList:[],
        currentContract:{},
        url:'/file/downloadFileto',
        logicsticsProcessOptions: [],
        tableSelection:[],
        conEffTypeOptions: [],
        conStatusOptions:[],
        interimVisible:false,
        delayVisible:false,
        interimTime:'',
        delayTime:'',
        visiblePrint:false,
        visibleCheck:false,
        conRateList:[],
        conIdTo:null,
        CON:"CON",
        pickerOptions: {
          shortcuts: [{
            text: '30天',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() + 3600 * 1000 * 24 * 30);
              picker.$emit('pick', date);
            }
          }, {
            text: '年底',
            onClick(picker) {
              const date = new Date();
              date.setUTCMonth(11)
              date.setUTCDate(31);
              date.setTime(date.getTime());
              picker.$emit('pick', date);
            }
          }, {
            text: '一年',
            onClick(picker) {
              const date = new Date();
              date.setTime(date.getTime() + 3600 * 1000 * 24 * 365);
              picker.$emit('pick', date);
            }
          }]
        },
        officialFile:{},
        isCheckOfficial:false,
        isCheckRate:false,
        signReportUrl:'',
        fileList:[],
        uploadDialogVisible: false,
        uploadUrl: "",
        baseApi:'',
        uploadFileType: "DRAFT", //上传文件类型
        myHeaders: {}, //请求头内容
        uploadDialogTital:'',
        deptLabelOptions:[],
        queryParams:{
          fileBusinessType:this.fileBusinessType,
          fileBusinessID:this.fileBusinessID,
          pageNum:1,
          pageSize:10,
        },
        fileListto:[],
        spanArr:[],
        // 遮罩层
        loading: true,
        // spanArr: [],
        rowIndex: '-1',
        fileNum:'',
        fileTypeNum:'',
        fileMustTypeNum:'',
        mustRequest:'',
        mustFlag:'',
        orderIndexArr: [],
        hoverOrderArr: [],
        getFileSummaryto:{},
        isto:"未完成",
        fid:"", //全局变量
        fileTypeId: "",//上传文件类型
        downloadDia:false,
        // 作业码头的options
        companyCodeOptions: [],
      };
    },

    computed: {
      // 是否显示提示
      showTip() {
        return this.isShowTip && (this.fileType || this.fileSize);
      },
      // 列表
      list() {
        let temp = 1;
        if (this.value) {
          // 首先将值转为数组
          const list = Array.isArray(this.value) ? this.value : [this.value];
          // 然后将数组转为对象数组
          return list.map((item) => {
            if (typeof item === "string") {
              item = { name: item, url: item };
            }
            item.uid = item.uid || new Date().getTime() + temp++;
            return item;
          });
        } else {
          this.fileList = [];
          return [];
        }
      },
    },

    created() {
      this.getDicts("con_fee_type").then((response) => {
        this.conEffTypeOptions = response.data;
      });
      this.baseApi = process.env.VUE_APP_BASE_API;
    },

    beforeMount() {},

    mounted() {
      this.getDicts("con_supply_type").then(response => {
        this.conSupplyOptions = response.data;
      });
      this.getDicts("con_fee_type").then(response =>{
        this.conEffOptions = response.data;
      })
      this.getDicts("business_type").then(response =>{
        this.conBusOptions = response.data;
      })
      this.getList();
    },

    methods: {
      async handleQuery() {
        this.queryForm.pageNum = 1;
        this.getList();
      },
      chonzhi(){
        this.resetForm();
      },
      resetForm(){
        this.queryForm={
            pageNum:1,
            pageSize:10
        }
        this.selectedconEffType=[];
        this.selectedStatus=[];
        listBusiness(this.queryForm).then(response =>{
          this.conBusinessList = response.rows;
          this.total = response.total;
          for(var i=0;i<this.conBusinessList.length;i++){
            if(this.conBusinessList[i].isTemplate=='0'){
              this.conBusinessList[i].isTemplate='否'
            }else if(this.conBusinessList[i].isTemplate=='1'){
              this.conBusinessList[i].isTemplate='是'
            }
          }
        })
      },
      // 文件个数超出
      handleExceed() {
        this.$message.error(`只允许上传单个文件`);
      },
      // 上传失败
      handleUploadError(err) {
        this.$message.error("上传失败, 请重试");
      },
      // 上传成功回调
      handleUploadSuccess(res, file) {
        this.$message.success("上传成功");
        this.$emit("input", res.data.url);
      },

      guid() {
        return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
          var r = Math.random() * 16 | 0,
            v = c == 'x' ? r : (r & 0x3 | 0x8);
          return v.toString(16);
        });
      },
      // 复制协议
      handleCopy(val){
        let query = {
          conId : val.conId
        }
        copyConBusiness(query).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("复制成功！");
            this.getList();
            this.$router.push('/con/condetail/data/'+response.data.conId)
          }
        })
      },
      getName(row){
        if(row.status==='冻结'){
          return row.conName + "(已冻结)";
        }else if(row.status == '临时生效'||row.status == '临时生效待审'){
//          return row.conName + "(临时生效)";
           return row.conName;
        }
        return row.conName;
      },
      delLine ({ row, column, rowIndex, columnIndex }) {
        if (row.isFrozen=='1' && column.id !== 'el-table_0_column_0' && column.id !== 'el-table_1_column_13'){
          return 'del_line'
        }
      },
      handleForzen(){
        if(this.currentContract.status=='作废'){
          this.msgError("合同已作废！");
          return;
        }
        this.$confirm(this.currentContract.status=='冻结'?'是否取消冻结？':'确认冻结？', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.frozenContract();
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
    importExcelSuccess(res) {
      if (res.code === 500) {
        this.msgError(res.msg);
        this.fileList = [];
      } else if (res.code === 200) {
        this.$modal.msgSuccess("上传成功!");
        this.getConFileList();
      }
    },
      CancelHandleInterim(){
        let data = {
          conId:this.currentContract.conId,
          isInterim:'0',
          interimTime:null
        }
        interimOper(data).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.getList();
          }
        })
      },
      //延期日期
      saveDelay(){
        let data = {
          conId:this.currentContract.conId,
          isInterim:'1',
          conEndTime:this.delayTime
        }
        delayOper(data).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.delayVisible = false;
            this.getList();
          }
        })
      },

      //设置临时生效日期
      saveInterim(){
        let data = {
          conId:this.currentContract.conId,
          isInterim:'1',
          interimTime:this.interimTime
        }
        interimOper(data).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.interimVisible = false;
            this.getList();
          }
        })
      },
      /**
       * 检测用户是否选中合同
       * @returns {boolean} true:选中合同，false:未选中合同
       */
      isCurrentContractSelected() {
        // 如果没有选中合同，弹出提示并返回false
        if(!this.currentContract.conCode && !this.currentContract.conId){
          this.$message({
            showClose: true,
            message: '请先点击选中要复制的合同',
            type: 'warning'
          });
          return false;
        }
        return true;
      },
      handleInvalid(){
        // 检测是否选中合同
        if (!this.isCurrentContractSelected()) {
          return;
        }
        this.$confirm('是否作废编号为'+this.currentContract.conCode+'合同？请谨慎使用。', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.nullifyContract();
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      deleteHandleInvalid(){
        // 检测是否选中合同
        if (!this.isCurrentContractSelected()) {
          return;
        }
        this.$confirm('是否删除编号为'+this.currentContract.conCode+'合同？删除后无法恢复，请谨慎使用。', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.deleteContractById();
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      restoreHandleInvalid(){
        // 检测是否选中合同
        if (!this.isCurrentContractSelected()) {
          return;
        }
        this.$confirm('是否恢复编号为'+this.currentContract.conCode+'合同？请谨慎使用。', '警告', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.restoreContract();
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消操作'
          });
        });
      },
      /**
       * 复制合同
       */
      handleCopyContract() {
        // 检测是否选中合同
        if (!this.isCurrentContractSelected()) {
          return;
        }
        this.$confirm('是否复制编号为【'+this.currentContract.conCode+'】的合同？', '确认', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          console.log('复制合同', this.currentContract.conCode, this.currentContract.conId);
          
          copyConBusiness(this.currentContract.conId).then(response => {
            if (response && response.code === 200) {
              this.$message({
                type: 'success',
                message: '复制成功！'
              });
              this.getList();
              this.$router.push('/con/condetail/data/' + response.data.conId)
            }
          })
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消合同复制操作'
          });
        });
      },
      frozenContract(){
        frozenContractById(this.currentContract.conId).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.getList();
          }
        })
      },
      nullifyContract(){
        nullifyContractById(this.currentContract.conId).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.getList();
          }
        })
      },
      deleteContractById(){
        deleteContractById(this.currentContract.conId).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.getList();
          }
        })
      },
      restoreContract(){
        restoreNullifyContractById(this.currentContract.conId).then(response =>{
          if(response&&response.code===200){
            this.$modal.msgSuccess("操作成功");
            this.getList();
          }
        })
      },
      supplyFormat(row, column) {
        return this.selectDictLabel(this.conSupplyOptions, row.conSupplyType);
      },
      conEffFormat(row,column){
        return this.selectDictLabel(this.conEffOptions, row.conEffType);
      },
      conBusFormat(row){
        // console.log(row);
        let busName = ''
        if(!row.conBusinessTypeList){
          return '';
        }
        for(let i=0;i<row.conBusinessTypeList.length;i++){
          let bustype = row.conBusinessTypeList[i].conBusType;
          for(let i=0;i<this.logicsticsProcessOptions.length;i++){
            for(let j=0;j<this.logicsticsProcessOptions[i].options.length;j++){
              if(this.logicsticsProcessOptions[i].options[j].value==bustype){
                busName = busName + ' ' + this.logicsticsProcessOptions[i].options[j].label;
              }
              }
           }
        }
        return busName;
      },
      getList(){
        listBusiness(this.queryForm).then(response =>{
          this.conBusinessList = response.rows;
          this.total = response.total;
          for(var i=0;i<this.conBusinessList.length;i++){
            if(this.conBusinessList[i].isTemplate=='0'){
              this.conBusinessList[i].isTemplate='否'
            }else if(this.conBusinessList[i].isTemplate=='1'){
              this.conBusinessList[i].isTemplate='是'
            }
          }
        })
      },
      getListType(){
        this.queryForm.pageNum = 1;
        //多选框数据处理
//        alert("11111111"+this.selectedconEffType)
        if (this.selectedconEffType!=null&&this.selectedconEffType!="") {
            var a =this.selectedconEffType;
//            var c= a.splice(",");
           var d=[];
           for(var i=0;i<a.length;i++){
                d[i]="'"+a[i]+"'";
//                d[i]=a[i];
           }

          var b=d.join(',');
          this.queryForm.conEffType="("+b+")";
//          this.queryForm.conEffType=b;
        }else{
          this.queryForm.conEffType=null;
        }
        if (this.selectedStatus!=null&&this.selectedStatus!="") {
          var st = this.selectedStatus;
//            var c= a.splice(",");
          var ds = [];
          for (var i = 0; i < st.length; i++) {
//          ds[i]=st[i];
            ds[i] = "'" + st[i] + "'";
          }

          var bs = ds.join(',');
//        this.queryForm.status=bs;
          this.queryForm.status = "(" + bs + ")";
        }else{
          this.queryForm.status =null;
        }
//alert(this.queryForm.typeName)
        listBusiness(this.queryForm).then(response =>{
          this.conBusinessList = response.rows;
          this.total = response.total;
          for(var i=0;i<this.conBusinessList.length;i++){
            if(this.conBusinessList[i].isTemplate=='0'){
              this.conBusinessList[i].isTemplate='否'
            }else if(this.conBusinessList[i].isTemplate=='1'){
              this.conBusinessList[i].isTemplate='是'
            }
          }
        })
      },
      handleChoseChange(row){
        this.currentContract = row;
        this.interimTime = row.interimTime;
        var  conIdTo1=this.currentContract.conId;
        this.conIdTo=conIdTo1.toString();
      },
      handleSelectionChange(val){
        this.tableSelection = val;
      },
      handleConCheck(val){
        this.officialFile={};
        this.conRateList = [];
        if(val.status=='作废'){
          this.msgError("合同已作废！");
          return;
        }
//       alert( val.status);
        let isCheck = val.status;
        if(isCheck=='完结'||isCheck=='生效中'){
          this.$confirm("是否取消审批",'提示',{
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            let data = {
              conId : val.conId,
              isCheck: '0',
              conSignTime:this.conDetailForm.conSignTime
            }
            checkCon(data).then(response =>{
              if(response&&response.code===200){
                this.$modal.msgSuccess("操作成功！");
                this.getList();
              }
            })
          })
        }else{
          this.uploadDialogVisible = true;
          this.getConRateList(val.conId);
          let query = {
            conId:val.conId,
            fileType:'OFFICIAL'
          }
          getConFile(query).then(response =>{
            if(response&&response.code ===200){
              this.officialFile = response.data;
            }
          })

          getFileSummary(val.conId).then(res=>{
            this.getFileSummaryto=res.data;
            if(this.getFileSummaryto!=null) {
              this.fileNum = this.getFileSummaryto.fileNum;
              this.fileTypeNum = this.getFileSummaryto.fileTypeNum;
              this.fileMustTypeNum = this.getFileSummaryto.fileMustTypeNum;
              this.mustRequest = this.getFileSummaryto.mustRequest;
              if (this.getFileSummaryto.mustFlag == '1') {
                this.isto = "完成"
              } else {
                this.isto = "未完成"
              }
            }else{
              this.fileNum='',
                this.fileTypeNum ='',
                this.fileMustTypeNum ='',
                this.mustRequest ='',
                this.isto = "未完成"
            }
          });

          this.loading=true;
          let queryParams={
              fileBusinessType:'CON',
              fileBusinessID:val.conId,
              pageNum:1,
              pageSize:10,
            }
          getFileList(queryParams).then(response=> {
            if (response && response.code === 200) {
//            this.fileList = response.rows;
              this.total=response.total;
              this.fileList =this.mergeTableRow( response.rows, ['fileTypeName','fileTypeId']);
              this.loading=false;
            }
          });
        }
        getContractById(val.conId).then((response) => {
          this.conDetailForm = response.data;
        });
      },
      fileClick(row) { // 点击button按钮click事件
        this.$refs.inputer.dispatchEvent(new MouseEvent('click'))  // 触发input框的click事件
        this.fid=row.fileTypeId;
      },
      uploadFileHandle(){
        if(!this.fileBusinessID){
          this.msgError("请先保存合同！");
          return;
        }
        this.fileList=[];
        this.uploadDialogVisible=true;
        this.getFileList();
        this.getFileSummary();
        var token = getToken();
        this.uploadUrl=this.baseApi;
        this.myHeaders={Authorization:token};
//        this.uploadUrl= this.baseApi +"/base/business/uploadNew?fileBusinessID="+this.fileBusinessID+"&fileTypeId="+row.fileTypeId;
      },

      objectSpanMethod({ row, column, rowIndex, columnIndex }) {
        const span = column['property'] + '-span'
        if(row[span]){
          return row[span]
        }
      },
      /**
       *
       *  合并行 */
      mergeTableRow(data, merge) {
        if (!merge || merge.length === 0) {
          return data
        }
        merge.forEach((m) => {
          const mList = {}
          data = data.map((v, index) => {
            const rowVal = v[m]
            if (mList[rowVal]) {
              mList[rowVal]++
              data[index - (mList[rowVal] - 1)][m + '-span'].rowspan++
              v[m + '-span'] = {
                rowspan: 0,
                colspan: 0
              }
            } else {
              mList[rowVal] = 1
              v[m + '-span'] = {
                rowspan: 1,
                colspan: 1
              }
            }
            return v
          })
        })
        return data
      },
      handleCheckClose(){
        if(this.officialFile.length<0){
          this.msgError("无正本，无法审核！");
          return;
        }else if(this.conDetailForm.conSignTime==null){
          this.msgError("请选择合同签订时间！");
          return;
        }else{
          this.uploadDialogVisible = false
          this.isCheckOfficial = true;
        }
        if(this.isCheckOfficial==true){
            let data = {
              conId : this.currentContract.conId,
              isCheck: "1",
              conSignTime:this.conDetailForm.conSignTime
            }
            checkCon(data).then(response =>{
              if(response&&response.code===200){
                this.$modal.msgSuccess("操作成功！");
                this.getList();
              }
              editContract(this.conDetailForm).then((response) => {
                if (!response || response.code!= 200) {
                  this.msgError("合同签订时间更新失败！");
                }
              });
            })
        }
        this.isCheckOfficial = false
        this.isCheckRate = false
        this.visibleCheck = false;
        done();
      },

      handleCheckOfficial(){
        if(this.officialFile.length>0){
          this.uploadDialogVisible = false
          this.isCheckOfficial = true;
        }else{
          this.msgError("无正本，无法审核！");
        }
      }
    },
    watch: {}
  }

</script>
<style scoped>
  .upload-file-uploader {
    margin-bottom: 5px;
  }
  .upload-file-list .el-upload-list__item {
    /*border: 1px solid #e4e7ed;*/
    line-height: 2;
    margin-bottom: 10px;
    position: relative;
  }
  .upload-file-list .ele-upload-list__item-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: inherit;
  }
  .ele-upload-list__item-content-action .el-link {
    margin-right: 10px;
  }
  .save_buttonto1 {
    font-size: 24px;
  }

.i_table_success{
  color: #00ff33;
}
.i_table_fail{
  color: red;
}
.el-table--medium th, .el-table--medium td {
    padding: 3px 0;
}

</style>
<style>
 .del_line::after {
	content: no-open-quote;
	position: absolute;
	top: 51%;
	left: 0;
	width:100%;
	border-bottom: 1px solid #F00;
}
 .el-table .isInterim-row{
   background: #FFFFCD;
 }
 .el-table .isInterim-rowwj{
   background:#cbdcbf;
 }
 .el-table .isInterim-rowds{
   background:#aabfe7;
 }
</style>
